//编写数据库链接URL
//mongodb无密码的链接方式
let url='mongodb://127.0.0.1:27017/ExamSystem';

//引入mongoose
let mongoose = require('mongoose');
//链接数据库
mongoose.connect(url,{
    useNewUrlParser:true,
    useUnifiedTopology:true
});
//设置链接成功要执行的回调函数
mongoose.connection.on('connected',function(){
    console.log('数据库连接成功')
});

